﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using _300Report.domain;
using _300Report.Global;
using _300Report.Pages;

namespace _300Report.Control
{
    public partial class MatchInfoControl : UserControl
    {
        public MatchInfoControl()
        {
            InitializeComponent();
        }

       
        public ListBox WinSide
        {
            get { return this.ListBoxWindSide; }
            set { this.ListBoxWindSide = value; }
        }

        public ListBox LoseSide
        {
            get { return this.ListBoxLoseSide; }
            set { this.ListBoxLoseSide = value; }
        }

        private void ListBoxWindSide_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var v = e.AddedItems;
            if (v != null && v.Count > 0 && (v[0] as MactchInfo.RoleInMatch).RoleName != null)
            {   //RoleListPage.Instance.NavigationService
                NavigationHelper.NavigateExt(RoleListPage.Instance.NavigationService, "/MainPage.xaml", SearchReportHistoryPage.SearcHistoryKey, (v[0] as MactchInfo.RoleInMatch).RoleName);
            }
        }
    }
}
